<?php

namespace app\admin\validate;

use think\Validate;

class Category extends Validate
{
    //验证规则
    protected $rule = [
        'parent_id' => 'require|number',
        'name' => 'require|max:30',
        'title' => 'require|max:30',
        //'email' => 'email',
    ];
    //提示信息
    protected $message = [
        'parent_id.require' => ' 父级栏目不能为空 ',
        'parent_id.number' => ' 父级栏目必须是数字 ',
        'name.require' => ' 栏目名称不能为空 ',
        'title.require' => ' 标题不能为空 ',
        'name.max' => ' 栏目名称不能超过30个字符 ',
        //'email' => ' 邮箱格式错误 ',
    ];
    //场景验证 -- 栏目暂时不用
    /*protected $scene = [
        'add' => ['name', 'email'],
        'edit' => ['email'],
    ];*/
}